
package com.dhcc.bpm.modules.orga.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dhcc.bpm.modules.common.vo.SelectVo;
import com.dhcc.bpm.modules.log.vo.AppApiViewVo;
import com.dhcc.bpm.modules.log.vo.AppRankVo;
import com.dhcc.bpm.modules.orga.entity.App;
import com.dhcc.bpm.modules.orga.entity.AppApi;
import com.dhcc.bpm.modules.orga.vo.AppTestNewVo;
import com.dhcc.bpm.modules.orga.vo.AppTestVo;
import com.dhcc.bpm.modules.orga.vo.AppVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName AppMapper
 * @Description 应用/渠道信息  Mapper 接口
 * @Author daina
 * @Date 2020/2/24 19:25
 * @Version V1.0
 * @Copyright: 2020 东华软件 . All rights reserved.
 */
public interface AppMapper extends BaseMapper<App> {

    /**
     * @param page
     * @param app
     * @return java.util.List<com.dhcc.bpm.modules.orga.vo.AppVO>
     * @Description 自定义分页
     * @Author daina
     * @Date 10:06 2020/2/25
     **/
    List<AppVO> selectAppPage(IPage<AppVO> page, AppVO app);

    List<AppVO> listApp(IPage<AppVO> page, AppVO app);

    /**
     * @param page
     * @param app
     * @return java.util.List<com.dhcc.bpm.modules.orga.vo.AppVO>
     * @Description 自定义分页
     * @Author daina
     * @Date 10:06 2020/2/25
     **/
    List<AppVO> selectAppFlow(IPage<AppVO> page, AppVO app);

    /**
     * @param page
     * @param app
     * @return java.util.List<com.dhcc.bpm.modules.orga.vo.AppVO>
     * @Description 查询渠道列表
     * @Author daina
     * @Date 10:06 2020/2/25
     **/
    List<AppVO> selectControllerAppList(IPage<AppVO> page, AppVO app);

    /**
     * @param appId
     * @return com.dhcc.bpm.modules.orga.entity.App
     * @Description 根据渠道编码查询
     * @Author daina
     * @Date 10:06 2020/2/25
     **/
    App selectByAppCode(String appId);
    /**
     * @Description 根据产品id查询订阅该产品的渠道
     * @Author daina
     * @Date 14:21 2020/4/10
     * @param opcProductId
     * @return java.util.List<com.dhcc.bpm.modules.orga.entity.App>
     **/
    List<App> listByProductId(Long opcProductId);
    /**
     * @param page
     * @param app
     * @return java.util.List<com.dhcc.bpm.modules.orga.vo.AppVO>
     * @Description 查询未分配的渠道列表
     * @Author daina
     * @Date 10:07 2020/2/25
     **/
    List<AppVO> selectUnControllerAppList(IPage<AppVO> page, AppVO app);

    /**
     * @param page
     * @param app
     * @return java.util.List<com.dhcc.bpm.modules.orga.vo.AppVO>
     * @Description 查询未分配的网关渠道列表
     * @Author daina
     * @Date 10:07 2020/2/25
     **/
    List<AppVO> UnControllerOrgaGateList(IPage<AppVO> page, AppVO app);

    /**
     * @Description 更新
     * @Author daina
     * @Date 10:07 2020/2/25
     * @param opc_app_id
     * @param valid_status
     * @return int
     **/
    int updateOpc_app_api(Long opc_app_id, String valid_status);
    /**
     * @Description 更新
     * @Author daina
     * @Date 10:07 2020/2/25
     * @param appApi
     * @return int
     **/
    int updateSingleOpc_app_api(AppApi appApi);
    /**
     * @Description 查询关联api
     * @Author daina
     * @Date 10:08 2020/2/25
     * @param opcAppId
     * @return java.util.List<com.dhcc.bpm.modules.orga.entity.AppApi>
     **/
    List<AppApi> listRelatedApi(Long opcAppId);
    /**
     * @Description 查询应用信息
     * @Author daina
     * @Date 10:08 2020/2/25
     * @param appCode
     * @return com.dhcc.bpm.modules.orga.entity.App
     **/
    App selectAppByAppCode(String appCode);
    /**
     * @Description 更新状态
     * @Author daina
     * @Date 10:08 2020/2/25
     * @param app
     * @return int
     **/
    int updateRefreshStatus(App app);
    /**
     * @Description 查询应用列表
     * @Author daina
     * @Date 10:08 2020/2/25
     * @param page
     * @param app
     * @return com.baomidou.mybatisplus.core.metadata.IPage<com.dhcc.bpm.modules.log.vo.AppApiViewVo>
     **/
    IPage<AppApiViewVo> selectAppList(IPage<AppApiViewVo> page, AppApiViewVo app);

    /**
     * @Description 统计数量
     * @Author daina
     * @Date 10:10 2020/2/25
     * @param
     * @return int
     **/
    int countApp();

    /**
     * @Description 应用变更信息
     * @Author sjm
     * @Date 14:10 2020/2/25 0025
     * @param page
     * @param app
     * @return java.util.List<com.dhcc.bpm.modules.orga.vo.AppVO>
     **/
    List<AppVO> changeList(IPage<AppVO> page, AppVO app);

    /**
     * @Description 申请测试信息
     * @Author sjm
     * @Date 18:47 2020/2/26 0026
     * @param id
     * @return com.dhcc.bpm.modules.orga.vo.AppTestVo
     **/
    AppTestVo selectAppInfo(Long id);

    /**
     * @Description 查询变更后申请测试信息
     * @Author sjm
     * @Date 9:31 2020/2/27 0027
     * @param id
     * @return com.dhcc.bpm.modules.orga.vo.AppTestNewVo
     **/
    AppTestNewVo selectAppInfoNew(Long id);
    /**
     * @Description 查询渠道变更未审批数量
     * @Author xiafayu
     * @Date 2020/4/10 16:35
     * @param parentId
     * @return int
     * @throws
     **/
    int changeNum(Long parentId);

    /**
     * @Description 渠道号查询
     * @Author xiafayu
     * @Date 2020/4/23 18:07
     * @param appId
     * @return java.util.List<com.dhcc.bpm.modules.orga.vo.AppVO>
     * @throws
     **/
    List<AppVO>  findByAppId(String appId);
    List<AppVO>  findByAppIds(AppVO appVO);
    List<AppVO>  getAppList(AppVO appVO);
    List<AppVO>  getAppListByBasePro(AppVO appVO);
    List<AppVO>  getAppListBySysId(AppVO appVO);
    /**
     * @Description 查询
     * @Author daina
     * @Date 15:49 2020/2/25
     * @param
     * @return java.util.List<com.dhcc.bpm.modules.common.vo.SelectVo>
     **/
    List<SelectVo> selectByAppName();

    boolean delAppIdAndPid(@Param("ids") List<Long> ids);

    List<App> findByPId(@Param("pid") String pid);

    List<App> getListByExpire(@Param("expire")String expire);


    List<SelectVo> selectAppName();

    IPage<AppRankVo> countAppNum(IPage<AppRankVo> page, AppRankVo appRank);

}
